<div id="engine-content">
    <div class="sidebar-left">
        <div class="project-browse">
            <div class="project-browse-l">项目浏览</div>
            <div class="project-browse-r"><a href="/html2/system#/project-manager" title="系统管理"><i class="icon-engine-set"></i></a></div>
            <div class="clear"></div>
        </div>
        <div class="select-project">
            <div class="select-project-l select-project-l-w"><i class="icon-engine-project"></i>{{currProjcet.projectName | maxLength:20}}</div>
            <div class="select-project-r">
                <a href="#/welcome"><i class="icon-engine-down-b" title="后退至项目选择"></i></a>
            </div>
            <div class="clear"></div>
        </div>

        <div ng-if="!currPackage || currPackage.projectid!=currProjcet.id"  class="select-gzb">
            <div class="select-project-l">在下方选择规则包</div>
            <div class="select-project-r">
                <a href="javascript:void(0)" ng-click="toggleSearch()"><i class="icon-engine-search"></i></a>
                <a href="#/welcome"><img src="/static/images/back.png" title="后退至项目选择"/></a>
            </div>
            <div class="clear"></div>
        </div>
        <div ng-if="currPackage && currPackage.projectid==currProjcet.id" class="select-gzb select-gzb-a">
            <div>
            <!--<div class="select-project-l select-project-l-w"><i class="icon-engine-package"></i>{{currPackage.name | maxLength:20}}</div>-->
                <div class="select-project-l">在下方选择规则包</div>
            <div class="select-project-r">
                <a href="javascript:void(0)" ng-click="toggleSearch2()"><i class="icon-engine-search"></i></a>
                <a href="#/projects/{{currProjcet.id}}/packages/{{currPackage.id}}"><i class="icon-engine-upward-b" title="进入规则包"></i></a>
            </div>
            <div class="clear"></div>
            </div>
            <div class="describe-a">{{currPackage.remark}}</div>
        </div>
        <div ng-show="showSearchPackage" class="search-project">
            <input type="text" class="project-name" ng-model="searchKey" placeholder="规则包名">
        </div>


        <div class="package-list" style="white-space: nowrap">
            <div class="project-title">项目：</div>
            <a ng-repeat="project in projects"
               ng-href="#/projects/{{project.id}}" ng-click="selectProject(project)">
                <div class="package-list-a">
                    <div class="package-list-l"><i class="icon-engine-project"/></div>
                    <div class="package-list-r">
                        <div class="package-name">{{project.projectName | maxLength:20}}</div>
                    </div>
                    <div class="clear"></div>
                </div>
            </a>

            <div class="project-title">规则包：</div>
            <a ng-repeat="pg in packages | filter:{'name': searchKey}" title="{{pg.name}}"
               ng-href="#/projects/{{projectId}}/packages/{{pg.id}}" ng-click="selectPackage(pg)">
                <div class="package-list-a">
                    <div class="package-list-l"><i class="icon-engine-package"></i></div>
                    <div class="package-list-r">
                        <div class="package-name">{{pg.name | maxLength:40}}</div>
                        <div class="describe">{{pg.remark | maxLength:40}}</div>
                    </div>
                    <div class="clear"></div>
                </div>
            </a>
        </div>
        <div class="build-project" pj-per="{{projectId}}|0">
            <button ng-click="createPackage()"  type="button" class="engine-btn-build" >新建规则包</button>
            <button ng-click="copyPackage()"  type="button" class="engine-btn-build" >复制规则包</button>
        </div>
    </div>
    <div class="sidebar-right">
        <div class="sidebar-right-title">开始</div>

        <div class="engine-tab">
            <ul>
                <li class="on"  data-key="package" ><a href="javascript:void(0)">历史规则包</a></li>
                <li data-key="jdbcService"><a href="javascript:void(0)">数据源组件配置</a></li>
                <li data-key="remoteService" ><a href="javascript:void(0)">远程服务配置</a></li>
                <li data-key="dubbo" ><a href="javascript:void(0)">dubbo服务配置</a></li>
                <li data-key="springCloud" ><a href="javascript:void(0)">SpringCloud服务配置</a></li>
                <li data-key="groovyShell" ><a href="javascript:void(0)">Groovy组件配置</a></li>
<!--
                <li data-key="check" ><a href="javascript:void(0)">数据校验配置</a></li>
-->

            </ul>
        </div>

        <div data-key="package" class="sidebar-right-content engine-tab-content">
            <div class="remind">
                <div class="remind-l"><img src="../../static/images/arrow.png"></div>
                <div class="remind-r">
                    <div class="tu"><i class="icon-engine-remind"></i></div>
                    <div class="text">从左侧边栏打开一个项目和规则包。</div>
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="rule-package">
                <g-data-source page="false" allow-auto-load="true" data-source-name="RecentlyPackagesDataSource" url="/grule-manager/recentlyLogs/packages"></g-data-source>
                <a href="#/projects/{{recentlyPackage.projectid}}/packages/{{recentlyPackage.id}}" ng-repeat="recentlyPackage in dataSources['RecentlyPackagesDataSource'].records">
                    <div class="{{getRecentlyPackageClass(recentlyPackage.id)}}">
                        <div class="package-tu"><i class="icon-engine-package"></i></div>
                        <div class="package-name">{{recentlyPackage.packageName}}</div>
                    </div>
                </a>

                <div class="clear"></div>
            </div>
            <div class="wrong-package">
                <div class="title">
                    <div class="title-l">以下规则包发生异常</div>
                    <div class="title-r"><a href="#">更多>></a></div>
                    <div class="clear"></div>
                </div>
                <div class="wrong-content">
                    <a href="#">
                        <div class="wrong-a" ng-repeat="report in reports">
                            <div class="wrong-a-l"><em>[{{ $index}}]</em>{{report.packageName}}</div>
                            <div class="wrong-a-r">运行{{report.normalCount}}次,平均时间{{report.normalExecutionTime}}ms,发生错误</div>
                            <div class="clear"></div>
                        </div>
                    </a>
                </div>
            </div>
        </div>

        <div class="engine-tab-content"  data-key="jdbcService" >
            <div  ng-include="'../html2/component/jdbcService'" ng-controller="JdbcController"></div>
        </div>
        <div class="engine-tab-content"  data-key="remoteService" >
            <div  ng-include="'../html2/component/remoteService'" ng-controller="RemoteController"></div>
        </div>
        <div class="engine-tab-content"  data-key="dubbo" >
            <div  ng-include="'../html2/component/dubbo'" ng-controller="DubboController"></div>
        </div>
        <div class="engine-tab-content"  data-key="springCloud" >
            <div  ng-include="'../html2/component/springCloudService'" ng-controller="SpringCloudController"></div>
        </div>
        <div class="engine-tab-content"  data-key="groovyShell" >
            <div  ng-include="'../html2/component/groovyShellService'" ng-controller="GroovyShellController"></div>
        </div>
        <div class="engine-tab-content"  data-key="check" >
            <div  ng-include="'../html2/component/validator'" ng-controller="ValidatorController"></div>
        </div>


    </div>
</div>
